<template>
  <!--demo 插槽作用域变量-->
  <slot name="parent" :demo="demo">子组件</slot>
</template>

<script>
  import { ref } from 'vue'
  export default {
    setup(props, context)
    {
      //定义变量
      var demo = ref('hello world')

      return {
        demo
      }
    }
  }
</script>